Skip to content

fix(py): filename sanitization, conn guard, retry clamp, set for hard_skips#39

Merged
Neo23x0 merged 1 commit intoNextronSystems:script-robustnessfrom
Colossus14:script-robustness
Mar 17, 2026
Merged

fix(py): filename sanitization, conn guard, retry clamp, set for hard_skips#39
Neo23x0 merged 1 commit intoNextronSystems:script-robustnessfrom
Colossus14:script-robustness

Conversation

@Colossus14
Copy link
Copy Markdown

Four fixes in the Python 3 collector, found by Axiom-Loop review:

  1. Filename sanitization — backslashes and NUL bytes now replaced in Content-Disposition header, preventing potential header injection
  2. Connection guardconn = None before try block prevents NameError in finally if _make_connection raises
  3. Retry-After clampmax(0, min(int(val), 300)) replaces separate negative check; cleaner and handles edge cases
  4. Set for hard_skips — O(1) membership check instead of O(n) list scan in mount-point dedup loop

… retry, use set for hard_skips

- Filename sanitization: also replace backslashes and NUL bytes in
  Content-Disposition header to prevent header injection
- Connection close: initialize conn=None before try block so the
  finally block doesn't hit NameError if _make_connection raises
- Retry-After: clamp to 0-300s with max(0, min(...)) instead of
  separate negative check
- hard_skips: use a set for O(1) membership checks instead of O(n)
  list scan in the mount-point dedup loop
@Neo23x0 Neo23x0 merged commit e3bbccf into NextronSystems:script-robustness Mar 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants